package T01_test_all.test13_stringBuilder;

public class T13_pinjie {
    public static void main(String[] args) {
        int[] arr = {1,2,3};
        String str = getStringForArr(arr);
        System.out.println(str);
    }

    public static String getStringForArr(int[] arr){
        StringBuilder sb = new StringBuilder();
        sb.append("[");
        for (int i = 0; i < arr.length; i++) {
            if(i == arr.length - 1){
                sb.append("");
            }else {
                sb.append(",");
            }
        }
        sb.append("]");
        return sb.toString();
    }
}
